package com.tcoiss.datafactory.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.tcoiss.datafactory.mapper.KdSalePlanCategoryMapper;
import com.tcoiss.datafactory.domain.KdSalePlanCategory;
import com.tcoiss.datafactory.service.IKdSalePlanCategoryService;

import java.util.List;


/**
 * 销售计划类别配置Service业务层处理
 *
 * @author zw
 * @date 2021-06-19
 */
@Service
public class KdSalePlanCategoryServiceImpl extends ServiceImpl<KdSalePlanCategoryMapper, KdSalePlanCategory> implements IKdSalePlanCategoryService {

    @Override
    public List<KdSalePlanCategory> queryList(KdSalePlanCategory kdSalePlanCategory) {
        LambdaQueryWrapper<KdSalePlanCategory> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(kdSalePlanCategory.getGoodsClassNo())){
            lqw.eq(KdSalePlanCategory::getGoodsClassNo ,kdSalePlanCategory.getGoodsClassNo());
        }
        if (StringUtils.isNotBlank(kdSalePlanCategory.getClassNo())){
            lqw.eq(KdSalePlanCategory::getClassNo ,kdSalePlanCategory.getClassNo());
        }
        if (StringUtils.isNotBlank(kdSalePlanCategory.getEnable())){
            lqw.eq(KdSalePlanCategory::getEnable ,kdSalePlanCategory.getEnable());
        }
        return this.list(lqw);
    }
}
